package com.hex.ds.code.detection.pack.service;

import com.hex.ds.code.detection.common.entity.ScriptPackScanItemEntity;
import com.hex.ds.code.detection.pack.entity.ScriptPackScanListEntity;

import java.util.List;

public interface IScanScriptFileService {

    /**
     * @Method scanInitScriptFile
     * @Param
     * @param scriptPackScanItemList
     * @param scriptPackScanList
     * @Return void
     * @Description 异步扫描初始化脚本文件
     * @Author Wang zhihao
     * @Date 2023/10/9 11:32
     * @Version V1.0
     */
    void scanInitScriptFile(List<ScriptPackScanItemEntity> scriptPackScanItemList, List<ScriptPackScanItemEntity> scriptPackScanHqlItemList, ScriptPackScanListEntity scriptPackScanList, List<String> timePartitionTableList, String clusterName);

    /**
     * @Method scanShellScriptFile
     * @Param
     * @param scriptPackScanItemList
     * @param scriptPackScanList
     * @Return void
     * @Description 异步扫描初始化Shell脚本文件
     * @Author Wang zhihao
     * @Date 2024/1/30 11:17
     * @Version V1.0
     */
    void scanShellScriptFile(List<ScriptPackScanItemEntity> scriptPackScanItemList, ScriptPackScanListEntity scriptPackScanList);

    /**
     * @Method scanServiceScriptFile
     * @Param
     * @param scriptPackScanItemList
     * @param scriptPackScanList
     * @Return void
     * @Description 异步扫描业务脚本文件
     * @Author Wang zhihao
     * @Date 2023/10/11 10:48
     * @Version V1.0
     */
    void scanServiceScriptFile(List<ScriptPackScanItemEntity> scriptPackScanItemList, ScriptPackScanListEntity scriptPackScanList, String clusterName);

    /**
     * @Method scanPeriodScriptFile
     * @Param
     * @param scriptPackScanItemList
     * @param scriptPackScanList
     * @Return void
     * @Description 异步扫描周期化脚本文件
     * @Author Wang zhihao
     * @Date 2023/10/9 13:16
     * @Version V1.0
     */
    void scanPeriodScriptFile(List<ScriptPackScanItemEntity> scriptPackScanItemList, List<ScriptPackScanItemEntity> scriptPackScanHqlItemList, ScriptPackScanListEntity scriptPackScanList, List<String> timePartitionTableList, String clusterName);

    /**
     * @Method refreshTaskState
     * @Param
     * @Return void
     * @Description 刷新任务状态
     * @Author Wang zhihao
     * @Date 2023/10/24 14:08
     * @Version V1.0
     */
    void refreshTaskState(String taskId);

    /**
     * @Method getSqlByReadFile
     * @Param
     * @param filePath
     * @Return java.util.List<java.lang.String>
     * @Description 读取代码并剔除被/*注释的代码， 然后以";"分割返回代码块
     * @Author Wang zhihao
     * @Date 2023/12/1 15:05
     * @Version V1.0
     */
    List<String> getSqlByReadFile(String filePath);
}
